<template>
	<div style="padding:0px;">
	    <el-form :model="dialogForm" ref="dialogForm">
	   	    <el-form-item :label="menuDialogSendData.data.label" :label-width="formLabelWidth" prop="qcsl">
		        <el-checkbox-group v-model="dialogForm.type">
			      <el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
			      <el-checkbox label="地推活动" name="type"></el-checkbox>
			      <el-checkbox label="线下主题活动" name="type"></el-checkbox>
			      <el-checkbox label="单纯品牌曝光" name="type"></el-checkbox>
			    </el-checkbox-group>
		    </el-form-item>
	    </el-form>
		<div  style="text-align:right;margin-top:15px;">
			 <el-button @click="returnBack">返 回</el-button>
			 <el-button type="primary" @click="editData()">提 交</el-button>
		</div>
	</div>
</template>
<script>
    import agentHttp from '@/utils/agentHttp.js'
	export default{
		components:{},
		created(){		
			this.selectData(); 
        },

        updated(){
        },
		props:['menuDialogSendData'],
		data(){
			return{
				formLabelWidth:'170px',
				//弹窗或者查看页面信息
		         dialogForm:{
		          type:[]
		         
		        }
			}
		},methods:{
			returnBack(){
				this.menuDialogSendData.dialogFormVisible=false;
			},
			
		    editData(){
		    	
		        agentHttp.putJson('adminApi/admin/carousel/put_validated',this.dialogForm).then((data)=>{
		            if(data.success){  
		            	this.$emit('refreshSeachData', null);
		            	
		            	this.$message.success(data.data||"修改成功");
		            } 
		        }) 
		    },
		    selectData(){
		    	//console.log('取消下方注释，修改请求地址')
		        agentHttp.get('adminApi/admin/carousel/select_carousel/'+this.menuDialogSendData.id).then((data)=>{	
		            if(data.success){  
		            	this.dialogForm=data.data;
		            	this.$set(this.dialogForm,'type',[]);
		            	
		            } 
		        }) 
		    },

		}
	}
</script>
